home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 42 / 042.d81 / calorie selector (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  16KB  |  617 lines

  1. 100 rem *****************************
  2. 110 rem ****  disk menu sequence ****
  3. 120 rem *****************************
  4. 130 rem
  5. 140 dim f1$(105)
  6. 150 dim f2$(105)
  7. 160 dim f3%(105)
  8. 170 dim mc$(20)
  9. 180 dim m1$(20)
  10. 190 dim m2$(20)
  11. 200 dim m3%(20)
  12. 210 dim mx$(20)
  13. 220 ct%=0
  14. 230 gosub500 
  15. 240 rem
  16. 250 gosub310 
  17. 260 goto1310  
  18. 270 rem
  19. 280 rem **  **  **  **  **  **  ** **
  20. 290 rem          border routine
  21. 300 rem **  **  **  **  **  **  ** **
  22. 310 print"[147][158]";chr$(142)chr$(8);:poke53280,14:poke53281,0
  23. 320 fori=1to38:print"[166][146]";:next
  24. 330 fori=1to22:print"[157][166][146]";:next
  25. 340 fori=1to37:print"[157][157][166][146]";:next
  26. 350 fori=1to22:print"[145][157][166][146]";:next
  27. 360 return
  28. 370 rem
  29. 380 rem **  **  **  **  **  **  ** **
  30. 390 rem        clear list routine
  31. 400 rem **  **  **  **  **  **  ** **
  32. 410 print "[147]     i am working"
  33. 420 for i=1to105
  34. 430 f1$(i)="zzz":f2$(i)="z":f3%(i)=0
  35. 440 next i
  36. 450 return
  37. 460 rem
  38. 470 rem **  **  **  **  **  **  ** **
  39. 480 rem        clear menu routine
  40. 490 rem **  **  **  **  **  **  ** **
  41. 500 for i=1to20
  42. 510 mc$(i)="z":m1$(i)="zzz"
  43. 520 m2$(i)="x":m3%(i)=0
  44. 530 next i
  45. 540 ct%=0
  46. 550 return
  47. 560 rem **  **  **  **  **  **  ** **
  48. 570 rem        read group in
  49. 580 rem **  **  **  **  **  **  ** **
  50. 590 print "[147]   please wait !!!!!"
  51. 600 print "[158]reading ";nf$;"[158] from disk"
  52. 610 open15,8,15,"io"
  53. 620 gosub1030 
  54. 630 open5,8,5,"0:"+nf$+",seq,r"
  55. 640 gosub1030 
  56. 650 if en=62 then return
  57. 660 for i=1 to 105
  58. 670 input#5,f1$(i)
  59. 680 gosub1030 
  60. 690 if f1$(i)="zzz" then goto750 
  61. 700 input#5,f2$(i)
  62. 710 gosub1030 
  63. 720 input#5,f3%(i)
  64. 730 gosub1030 
  65. 740 next i
  66. 750 close5:close15
  67. 760 return
  68. 770 rem
  69. 780 rem **  **  **  **  **  **  ** **
  70. 790 rem        write group to disk
  71. 800 rem **  **  **  **  **  **  ** **
  72. 810 print "[147]   please wait !!!!!"
  73. 820 print "writing ";nf$;" to disk"
  74. 830 open15,8,15,"io"
  75. 840 gosub1030 
  76. 850 open5,8,5,"@0:"+nf$+",seq,w"
  77. 860 gosub1030 
  78. 870 for i=1 to 105
  79. 880 print#5,f1$(i)
  80. 890 gosub1030 
  81. 900 print#5,f2$(i)
  82. 910 gosub1030 
  83. 920 print#5,f3%(i)
  84. 930 gosub1030 
  85. 940 if f1$="zzz" then goto960 
  86. 950 next i
  87. 960 close5:close15
  88. 970 ct%=0
  89. 980 return
  90. 990 rem
  91. 1000 rem **  **  **  **  **  **  **  **
  92. 1010 rem         error read routine
  93. 1020 rem **  **  **  **  **  **  ** **
  94. 1030 input#15,en,em$,et,es
  95. 1040 if en=0 then return
  96. 1050 if en=62 then goto1130 
  97. 1060 print "";em$
  98. 1070 print " see your drive manual for the specfic "
  99. 1080 print " error condition for number [158]";en
  100. 1090 close5:close15
  101. 1100 ti$ ="000000"
  102. 1110 if ti$ < "000008" then goto1110  
  103. 1120 goto230 
  104. 1130 print " file not started "
  105. 1140 print "  please enter data on next screen "
  106. 1150 ti$ ="000000"
  107. 1160 if ti$ < "000008" then goto1160  
  108. 1170 close5:close15
  109. 1180 return
  110. 1190 rem
  111. 1200 :
  112. 1210 open15,4,15:close15:if(st=.)then1218
  113. 1212 print"          [150]printer not online![145]"
  114. 1214 fora=1to55:poke54296,15:poke54296,.:next
  115. 1216 print"                                 [145]":return
  116. 1218 print"        [154]printing -- please wait.[145]"
  117. 1219 open1,3:open2,4,7:print#1,chr$(19);
  118. 1220 for m=1 to 23:a$="             "
  119. 1230 forl=1to40:get#1,b$:a$=a$+b$:next
  120. 1240 r$=chr$(13):if b$=r$ then1260 
  121. 1250 print#2,a$:next m:goto1270 
  122. 1260 print#2,a$;:next m
  123. 1270 print#2:close 2:print#1:close 1
  124. 1275 print"                                 [145]"
  125. 1280 return
  126. 1290 rem
  127. 1300 rem **  **  **  **  **  **  ** **
  128. 1310 print""
  129. 1320 printtab(16)"loadstar"
  130. 1330 printtab(16)"presents"
  131. 1340 print"  calorie   "
  132. 1350 print"  selector    "
  133. 1360 print"       program"
  134. 1370 print"[158]    by"
  135. 1380 print"   richard melanson"
  136. 1390 print"    copyright 1987"
  137. 1400 ti$ ="000000"
  138. 1410 if ti$ < "000002" then goto1410
  139. 1420 rem
  140. 1430 rem **  **  **  **  **  **  **  **
  141. 1440 gosub310 
  142. 1450 print"[158]                      "
  143. 1460 print"   calorie selector   "
  144. 1470 print"[158]                      "
  145. 1480 print"  function selection  "
  146. 1490 print"[158]f.  food files[158]"
  147. 1500 print"     add,change,or[160]review"
  148. 1510 print"     your food files"
  149. 1520 print"     make selections"
  150. 1530 print"     for a daily meal menu"
  151. 1540 print"m.  menu review[158]"
  152. 1550 print"     review, or save the"
  153. 1560 print"     current work menu"
  154. 1570 print"g.  general[160]information[158]"
  155. 1580 print"q.  quit[158] program"
  156. 1590 print"[145][159]input function letter"
  157. 1600 rp$="":poke198,.
  158. 1610 get rp$:if rp$=""then goto1610  
  159. 1620 if rp$ ="f" then goto1800  
  160. 1630 if rp$ ="m" then goto3970  
  161. 1640 if rp$ ="3" then goto1710  
  162. 1650 if rp$ ="4" then goto1710  
  163. 1660 if rp$ ="5" then goto1710  
  164. 1670 if rp$ ="6" then goto1710  
  165. 1680 if rp$ ="g" then goto4900  
  166. 1690 if rp$ ="q" then1745
  167. 1700 rem **  **  **  **  **  **  **  **
  168. 1710 print"[145]     not defined     "
  169. 1720 ti$ ="000000"
  170. 1730 if ti$ < "000001" then goto1730
  171. 1740 goto1450  
  172. 1745 print"[147]     are you absolutely, positively"
  173. 1746 print"      sure you want to quit? (y[159]/n[159])"
  174. 1747 geta$:ifa$<>"y"anda$<>"n"then1747
  175. 1748 ifa$="n"then1440
  176. 1750 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  177. 1760 ifer<>63thenend
  178. 1770 poke.,47:load"hello connect",8
  179. 1780 rem
  180. 1790 rem **  **  **  **  **  **  **  **
  181. 1800 gosub310 
  182. 1810 print"[158]                      "
  183. 1820 print"   calorie selector   "
  184. 1830 print"[158]        food          "
  185. 1840 print"   group selection    "
  186. 1850 print"1. [158]starch groups"
  187. 1860 print"2. [158]protein items"
  188. 1870 print"3. [158]fruit items"
  189. 1880 print"4. [158]vegetables"
  190. 1890 print"5. [158]fast foods"
  191. 1900 print"6. [158]fat items"
  192. 1910 print"7. [158]free items"
  193. 1920 print"8. [158]mixed foods"
  194. 1930 print"g. general information"
  195. 1940 print"r. back to function screen"
  196. 1950 print"[145][159]input group number"
  197. 1960 rp$=""
  198. 1970 get rp$:if rp$=""then goto1970  
  199. 1980 if rp$ ="1" then goto2150  
  200. 1990 if rp$ ="2" then goto2560  
  201. 2000 if rp$ ="3" then goto2570  
  202. 2010 if rp$ ="4" then goto2580  
  203. 2020 if rp$ ="5" then goto2590  
  204. 2030 if rp$ ="6" then goto2600  
  205. 2040 if rp$ ="7" then goto2610  
  206. 2050 if rp$ ="8" then goto2620  
  207. 2060 if rp$ ="r" then goto1440  
  208. 2070 if rp$ ="g" then goto4900  
  209. 2080 rem **  **  **  **  **  **  **  **
  210. 2090 print"[145] not defined "
  211. 2100 ti$ ="000000"
  212. 2110 if ti$ < "000002" then goto2110  
  213. 2120 goto1810  
  214. 2130 rem
  215. 2140 rem **  **  **  **  **  **  **  **
  216. 2150 gosub310 
  217. 2160 print"[158]                      "
  218. 2170 print"   calorie selector   "
  219. 2180 print"[158]        food          "
  220. 2190 print"   starch selection   "
  221. 2200 print"1. [158]breads"
  222. 2210 print"2. [158]cereals"
  223. 2220 print"3. [158]pastas"
  224. 2230 print"4. [158]cookies"
  225. 2240 print"5. [158]deserts"
  226. 2250 print"6. [158]crackers"
  227. 2260 print"7. [158]vegetables"
  228. 2270 print"q. back to group selection"
  229. 2280 print""
  230. 2290 print""
  231. 2300 print"[145][159]input starch number"
  232. 2310 rp$=""
  233. 2320 get rp$:if rp$=""then goto2320  
  234. 2330 if rp$ ="1" then goto2490  
  235. 2340 if rp$ ="2" then goto2500  
  236. 2350 if rp$ ="3" then goto2510  
  237. 2360 if rp$ ="4" then goto2520  
  238. 2370 if rp$ ="5" then goto2530  
  239. 2380 if rp$ ="6" then goto2540  
  240. 2390 if rp$ ="7" then goto2550  
  241. 2400 if rp$ ="q" then1800
  242. 2410 rem **  **  **  **  **  **  **  **
  243. 2420 print"[145] not defined "
  244. 2430 ti$ ="000000"
  245. 2440 if ti$ < "000002" then goto2440  
  246. 2450 goto2160 
  247. 2460 rem
  248. 2470 rem **  **  **  **  **  **  **  **
  249. 2480 rem
  250. 2490 nf$="breads":goto2650 
  251. 2500 nf$="cereals":goto2650 
  252. 2510 nf$="pasta":goto2650 
  253. 2520 nf$="cookies":goto2650 
  254. 2530 nf$="dessert":goto2650 
  255. 2540 nf$="crackers":goto2650 
  256. 2550 nf$="stch-veget":goto2650 
  257. 2560 nf$="protein":goto2650 
  258. 2570 nf$="fruit":goto2650 
  259. 2580 nf$="vegetable":goto2650 
  260. 2590 nf$="fast-foods":goto2650 
  261. 2600 nf$="fat-items":goto2650 
  262. 2610 nf$="free-items":goto2650 
  263. 2620 nf$="mixed-foods":goto2650 
  264. 2630